//
//  WordChangePinYin.m
//  Air
//
//  Created by dongguozheng on 2017/2/23.
//  Copyright © 2017年 董国政. All rights reserved.
//

#import "WordChangePinYin.h"

@implementation WordChangePinYin
-(NSString *)transform:(NSString *)chinese
{
    NSMutableString *pinyin = [[chinese substringToIndex:[chinese length] - 1] mutableCopy];//剔除最后一个字符
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO);
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripCombiningMarks, NO);
    NSString *strUrl = [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""];//出去中间的空格
    return strUrl;
}
@end
